package com.hhh.sun.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hhh.sun.mapper.TbChargingMapper;
import com.hhh.sun.pojo.entity.TbCharging;
import com.hhh.sun.service.ChargingService;
import com.hhh.sun.vo.resp.PageResult;
import com.hhh.sun.vo.resp.R;
import org.springframework.stereotype.Service;

@Service
public class ChargingServiceImpl extends ServiceImpl<TbChargingMapper, TbCharging>implements ChargingService {
    /**
     * 分页查询所有的充电站信息
     */
    @Override
    public R<PageResult<TbCharging, TbCharging>> findAll(Integer pageNum, Integer pageSize) {
        IPage<TbCharging>page=new Page<>(pageNum,pageSize);
        baseMapper.selectPage(page,null);
        PageResult<TbCharging, TbCharging> result = new PageResult<>(page, page.getRecords());
        return R.ok(result);
    }
}
